import { increment as incrementFromModel } from "../../models/counter";
import { useAppDispatch, useAppSelector } from "../../models/index";

const Demo = () => {
  const count = useAppSelector((state) => state.counter);
  const dispatch = useAppDispatch();

  const increment = () => {
    dispatch(incrementFromModel());
  };

  return <div onClick={increment}>{count.value}</div>;
};

export default Demo;
